//
// Created by denglibin on 2020/6/30.
// 图的深度优先遍历

#include <stdio.h>
#include "../header/graph.h"

/**
 * 深度遍历图结构
 * @param graphNode
 */
static void dfs(GraphNode *graphNode)
{
    if (graphNode->is_visit)
    {
        return;
    }
    printf("%c ", graphNode->value);
    graphNode->is_visit = 1;
    for (int i = 0; i < graphNode->neighbor_num; i++)
    {
        dfs(graphNode->neighbor[i]);
    }
}
static int main1()
{
    GraphNode *graphNode = createSimple();
    dfs(graphNode);
    return 0;
}
